﻿<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>发布的工作</title>
<meta name="description" content="拉勾数据">
<meta name="keywords" content="二手房 房产经济 房企 开发商 拉勾数据 IFS">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed"
	href="assets/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="eosms for IFS" />
<link rel="stylesheet" href="assets/css/amazeui.min.css" />
<link rel="stylesheet" href="assets/css/admin.css">
</head>
<body>
	<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

	<jsp:include page="/manage_header.do" flush="true" />

	<div class="am-cf admin-main">
		<!-- sidebar start -->
				<jsp:include page="/manage_tree.do" flush="true" ></jsp:include>
		<!-- sidebar end -->

		<!-- content start -->
		<div class="admin-content">

			<div class="am-cf am-padding">
				<div class="am-fl am-cf">
					<strong class="am-text-primary am-text-lg">工作</strong> / <small>job</small>
				</div>
			</div>
			<form id="work_form" name="work_form" class="am-form" action="show_job.do" method="post">
				<input type="hidden" name="page_num" id="page_num" value="0">
				<div class="am-tabs am-margin" data-am-tabs>
					<ul class="am-tabs-nav am-nav am-nav-tabs">
						<li class="am-active"><a href="#tab1">基本信息</a></li>
					</ul>
					<div class="am-tabs-bd">
						<div class="am-tab-panel am-fade am-in am-active" id="tab1">
							
							<div class="am-g am-margin-top">
								<div class="am-u-sm-1 am-u-md-1 am-u-lg-1 am-text-right">
									发布人
								</div>
								<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
									<input type="text" name="user_name" id="user_name" value="${user_name}" />
								</div>
								<div class="am-u-sm-1 am-u-md-1 am-u-lg-1 am-text-right">
									小区
								</div>
								<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
									<input type="text" name="community_name" id="community_name" value="${community_name}" />
								</div>
								<div class="am-u-sm-1 am-u-md-1 am-u-lg-1 am-text-right">
									日期
								</div>
								<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
									<input type="text" class="am-form-field" name="create_time" id="create_time" value="${create_time}"  data-am-datepicker readonly required />
								</div>
							</div>
							
							<div class="am-g am-margin-top">
								<div class="am-u-sm-1 am-u-md-1 am-u-lg-1 am-text-right">
									装修
								</div>
								<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
									<select name="decoration_type" id="decoration_type">
										<option value="">全部</option>
										<option value="1" <c:if test="${decoration_type=='1'}">selected</c:if>>毛坯装修</option>
										<option value="2" <c:if test="${decoration_type=='2'}">selected</c:if>>旧房改造</option>
									</select>
								</div>	
								<div class="am-u-sm-1 am-u-md-1 am-u-lg-1 am-text-right">
									发布
								</div>
								<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
									<select name="release_status" id="release_status">
										<option value="">全部</option>
										<option value="1" <c:if test="${release_status=='1'}">selected</c:if>>已发布</option>
										<option value="2" <c:if test="${release_status=='2'}">selected</c:if>>未发布</option>
									</select>
								</div>
								<div class="am-u-sm-1 am-u-md-1 am-u-lg-1 am-text-right">
									状态
								</div>
								<div class="am-u-sm-3 am-u-md-3 am-u-lg-3">
									<select name="status" id="status">
										<option value="">全部</option>
										<option value="1" <c:if test="${status=='1'}">selected</c:if>>正常</option>
										<option value="2" <c:if test="${status=='2'}">selected</c:if>>删除</option>
									</select>
								</div>
							</div>
							
						</div>
						<div class="am-margin am-text-right">
							<button type="button" id="clear_button"
								class="am-btn am-btn-primary am-btn-xs">清空</button>
							<button type="button" id="search_button"
								class="am-btn am-btn-primary am-btn-xs">查询</button>
						</div>
					</div>
				</div>
			</form>
			<div class="am-g">
				<div class="am-u-sm-12">
					<form class="am-form">
						<table id="clients_table" class="am-table am-table-striped am-table-hover table-main">
							<thead>
								<tr>

									<th class="table-title" width="20%">发布人</th>
									<th class="table-title" width="20%">小区</th>
									<th class="table-title" width="20%">发布时间</th>
									<th class="table-title" width="20%">装修类型</th>
									<th class="table-title" width="10%">发布</th>
									<th class="table-title" width="10%">状态</th>
								</tr>
							</thead>
							<tbody>

								<c:forEach var="job" items="${jobs}" varStatus="s">
									<tr class="tr_click" job_id="${job.id}">
										<td>${job.user.name}</td>
										<td>${job.community}</td>
										<td>
										<fmt:parseDate value="${job.create_time}" var="create_time" pattern="yyyy-MM-dd HH:mm:ss"/>
										<fmt:formatDate value="${create_time}" pattern="yyyy-MM-dd HH:mm:ss"/>
										</td>
										<td><c:if test="${job.decoration_type == 1}">毛坯装修</c:if>
											<c:if test="${job.decoration_type == 2}">旧房改造</c:if></td>
										<td><c:if test="${job.release_status == 0}">未发布</c:if>
											<c:if test="${job.release_status == 1}">已发布</c:if></td>
										<td job_status="${job.status }" id="tr_status_${job.id }" class="td_click">
											<c:if test="${job.status == 1}">
												<button type="button" onclick="abc(1,1)" class="am-btn am-btn-primary am-active">正常</button>
											</c:if>
											<c:if test="${job.status == 0}">
												<button type="button" class="am-btn am-btn-primary am-active" id="button">删除</button>
											</c:if>
										</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<div class="am-cf">
							共<b id="pageCount"> ${page.allRow}</b> 条记录
							<div class="am-fr">
								<ul class="am-pagination">
									<c:choose>
										<c:when test="${page.currentPage==1}">
											<li class="am-disabled"><a href="#">«</a></li>
										</c:when>
										<c:when test="${page.currentPage!=1}">
											<li><a href="javascript:void(0)"
												onclick="choose_page(${page.currentPage-1})">«</a></li>
										</c:when>
									</c:choose>
									<c:forEach var="i" begin="1" end="${page.totalPage}" step="1">
										<c:choose>
											<c:when test="${page.currentPage==i}">
												<li class="am-active"><a href="javascript:void(0)"><c:out
															value="${i}" /></a></li>
											</c:when>
											<c:when test="${page.currentPage!=i}">
												<li><a href="javascript:void(0)"
													onclick="choose_page(${i})"><c:out value="${i}" /></a></li>
											</c:when>
										</c:choose>
									</c:forEach>
									<c:choose>
										<c:when test="${page.currentPage==page.totalPage}">
											<li class="am-disabled"><a href="#">»</a></li>
										</c:when>
										<c:when test="${page.currentPage!=page.totalPage}">
											<li><a href="javascript:void(0)"
												onclick="choose_page(${page.currentPage+1})">»</a></li>
										</c:when>
									</c:choose>
								</ul>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>

		<!-- content end -->

	</div>

	<a href="#" class="am-show-sm-only admin-menu"
		data-am-offcanvas="{target: '#admin-offcanvas'}"> <span
		class="am-icon-btn am-icon-th-list"></span>
	</a>

	<jsp:include page="/manage_foot.do" flush="true" />
</body>
</html>

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/app.js"></script>
<script type="text/javascript">
$(function() {
	
	 //机构列表点击事件
	 $(".tr_click").click(function(){
		 location.href="<%=request.getContextPath()%>/get_job.do?id="+$(this).attr("job_id");
	 });
	 
	 //清空按钮点击事件
	 $("#clear_button").click(function(){
		 //$(".tr_click").removeClass("am-active");
		 //$("#id").val(0);
		 $("#work_form")[0].reset();
	 });
	
	//查询按钮点击事件
	 $("#search_button").click(function(){
		 $("#work_form").submit();
	  //   $("#clear_button").show();
	 });
	
});

function choose_page(i){
	$("#page_num").val(i);
	$("#work_form").submit();
}

</script>
